package cn.edu.gduf.luowowo.article.query;

import cn.edu.gduf.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject {
    private Long authorId = -1L;
    private Long destId = -1L;
    private Integer dayType = -1;
    private Integer perExpendType = -1;
    private Integer travelTimeType = -1;
    private Integer orderType = 1;
    private Boolean isPublic = true;
    private Integer state = -1;

    public String getOrderBy() {
        return orderType == 1 ? "t.createTime desc" : "t.viewnum desc";
    }

    public TravelCondition getDays(){
        return TravelCondition.dayTypeMap.get(dayType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.perExpendTypeMap.get(perExpendType);
    }

    public TravelCondition getTravelTime(){
        return TravelCondition.travelTimeTypeMap.get(travelTimeType);
    }

}
